<template>
  <ex-dialog v-model="visible" draggable :title="form.name"
  width="700" :contentHeight="450">
    <template #default>
      <el-tabs v-model="activeName"  style="height: 100%">
        <el-tab-pane label="基本信息" name="base" style="height: 100%">
          <el-descriptions class="margin-top" :column="2" border>
			      <el-descriptions-item label="上级分类"><ex-label code="SysResource" :value="form.parentLevelCode"/></el-descriptions-item>
            <el-descriptions-item label="编码">{{form.code}}</el-descriptions-item>
            <el-descriptions-item label="名称">{{form.name}}</el-descriptions-item>
            <el-descriptions-item label="大类"><ex-label code="MAIN_CATEGORY" :value="form.mainCategoryCode"/></el-descriptions-item>
            <el-descriptions-item label="外部编码">{{form.externalCode}}</el-descriptions-item>
            <el-descriptions-item label="排序">{{form.orderWeight}}</el-descriptions-item>
            <el-descriptions-item label="描述">{{form.description}}</el-descriptions-item>
            <el-descriptions-item label="创建时间"><ex-label format code="DATETIME" :value="form.createTime"/></el-descriptions-item>
            <el-descriptions-item label="创建人"><ex-label code="SysUser" :value="form.createUser"/></el-descriptions-item>
			<el-descriptions-item label="是否可用"><ex-label code="IS_ENABLED" :value="form.isEnabled"/></el-descriptions-item>
          </el-descriptions>
        </el-tab-pane>
        <el-tab-pane label="资产属性" name="FamsColumn" style="height: 100%">
          <ex-rel-table ref="columnRelTable" size="small" :rel-entity="form" :treeApi="this.$API.asset.column.treeData" default-expand-all :selection="false">
            下级分类默认继承上级分类的资产属性
          </ex-rel-table>
        </el-tab-pane>
      </el-tabs>
    </template>
  </ex-dialog>
</template>

<script>
import ExRelTable from "@/components/exRelTable/index.vue";
import ExLabel from "@/components/exLabel/index.vue";
import exDialog from '@/components/exDialog';

export default {
  computed: {
  },
  emits: ['success'],
  components: {
	  ExLabel,
    ExRelTable,
    exDialog
  },
  props: {
  },
  data() {
    return {
      activeName: 'base',
      visible: false,
      form: {},
    }
  },
  methods: {
    //显示
    open(entity) {
      this.form = Object.assign({}, entity);
      this.visible = true;
      this.activeName = "base";
    },
  }
}
</script>

<style scoped>
h2 {
  font-size: 17px;
  color: #3c4a54;
  padding: 0 0 30px 0;
}

[data-theme="dark"] h2 {
  color: #fff;
}

</style>
